home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-01-19 | 18.4 KB | 870 lines | [TEXT/MPS ] |
- /*
- * Indent.r for GNU Indent
- *
- * Based on Roberto Avanzi's
- * but totally revamped by Franklin Chen
- *
- * Tue, Apr 6, 1993 Version 1.7
- * Wed, Jan 19, 1994 Version 1.8
- */
-
- #include "SysTypes.r"
- #include "Cmdo.r"
-
- resource 'vers' (1) {
- 0x1,
- 0x80,
- release,
- 0x0,
- verUS,
- "1.8",
- "1.8 © 1986-93 U.I., U.C., Sun, FSF, Inc., J. Arcenaux\nMPW port by R. Avanzi, F. Chen"
- };
-
- resource 'vers' (2) {
- 0x1,
- 0x80,
- release,
- 0x0,
- verUS,
- "1.8",
- "GNU for MPW"
- };
-
- resource 'cmdo' (128) {
- { /* array dialogs: 7 elements */
- /* [1] */
- 300,
- "Indent -- GNU Indent changes the appeara"
- "nce of C code by inserting or deleting w"
- "hitespace. It can be used to make code m"
- "ore readable or to convert from one writ"
- "ing style to another.",
- { /* array itemArray: 18 elements */
- /* [1] */
- NotDependent {
-
- },
- RadioButtons {
- { /* array radioArray: 2 elements */
- /* [1] */
- {20, 13, 36, 155}, "Several input files", "", Set, "Indent several input files, making a bac"
- "kup copy of each and replacing each orig"
- "inal file with its indented version. If"
- " you wish to write to an output file or "
- "standard output, please select a single "
- "file from 'Single input file' below.",
- /* [2] */
- {43, 13, 59, 155}, "Single input file", "", NotSet, "Indent only one input file. In this case"
- ", or when the standard input is used, yo"
- "u may specify an output file."
- }
- },
- /* [2] */
- Or {
- { /* array OrArray: 1 elements */
- /* [1] */
- 4097
- }
- },
- MultiFiles {
- "Input Files…",
- "Select several input files to indent.",
- {20, 164, 36, 271},
- "Files to indent:",
- "",
- MultiInputFiles {
- { /* array MultiTypesArray: 1 elements */
- /* [1] */
- text
- },
- ".c",
- "Only files that end in .c",
- "All text files"
- }
- },
- /* [3] */
- Or {
- { /* array OrArray: 1 elements */
- /* [1] */
- 8193
- }
- },
- Files {
- InputFile,
- OptionalFile {
- {0, 0, 0, 0},
- {43, 164, 59, 270},
- "",
- "Standard input",
- "",
- "",
- "Choose a single input file; the default "
- "is standard input.",
- dim,
- "Standard Input",
- "Select a file…",
- ""
- },
- Additional {
- "",
- ".c",
- "Only files that end in .c",
- "All text files",
- { /* array TypesArray: 1 elements */
- /* [1] */
- text
- }
- }
- },
- /* [4] */
- Or {
- { /* array OrArray: 1 elements */
- /* [1] */
- 8193
- }
- },
- Files {
- InputOrOutputFile,
- OptionalFile {
- {63, 44, 79, 124},
- {79, 30, 96, 149},
- "Output file",
- "Replace original",
- "-o",
- "",
- "Select the destination for the indented "
- "input.",
- dim,
- "Replace original (keep a backup)",
- "Write to existing file…",
- "Write to new file…"
- },
- Additional {
- "",
- ".c",
- "Only files that end in .c",
- "All text files",
- { /* array TypesArray: 1 elements */
- /* [1] */
- text
- }
- }
- },
- /* [5] */
- Or {
- { /* array OrArray: 1 elements */
- /* [1] */
- 8193
- }
- },
- CheckOption {
- NotSet,
- {72, 164, 90, 292},
- "Write to StdOut",
- "-st",
- "[--standard-output] Write to standard ou"
- "tput."
- },
- /* [6] */
- And {
- { /* array AndArray: 2 elements */
- /* [1] */
- 8193,
- /* [2] */
- -3
- }
- },
- Redirection {
- StandardInput,
- {27, 335}
- },
- /* [7] */
- Or {
- { /* array OrArray: 1 elements */
- /* [1] */
- 8193
- }
- },
- Redirection {
- StandardOutput,
- {66, 335}
- },
- /* [8] */
- NotDependent {
-
- },
- Redirection {
- DiagnosticOutput,
- {105, 335}
- },
- /* [9] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {20, 327, 144, 464},
- "Redirection"
- },
- /* [10] */
- NotDependent {
-
- },
- RadioButtons {
- { /* array radioArray: 3 elements */
- /* [1] */
- {117, 20, 135, 74}, "GNU", " -gnu", Set, "[--gnu-style] Use GNU coding style. This"
- " is the default. Equivalent to:\n-nbad -n"
- "bap -nbbb -nbc -bl -bli2 -c33 -cd33 -ncd"
- "b -nce -cli0 -cp1 -di0 -nfc1 -nfca -i2 -"
- "ip5 -lp -pcs -psl -nsc -nsob -nss -ts8",
- /* [2] */
- {117, 80, 135, 134}, "K&R", " -kr", NotSet, "[--k-and-r-style] Use Kernighan & Ritchi"
- "e coding style. Equivalent to:\n-nbad -ba"
- "p -nbbb -nbc -br -c33 -cd33 -ncdb -ce -c"
- "i4 -cli0 -cp33 -d0 -di1 -nfc1 -nfca -i4 "
- "-ip0 -l75 -lp -npcs -npsl -nsc -nsob -ns"
- "s -ts8",
- /* [3] */
- {117, 140, 135, 194}, "UCB", " -orig", NotSet, "[--original] Use original Berkeley codin"
- "g style. Equivalent to:\n-nbap -nbad -nbb"
- "b -bc -br -c33 -cd33 -cdb -ce -ci4 -cli0"
- " -cp33 -d4 -di16 -fc1 -fca -i4 -ip4 -l75"
- " -lp -npcs -psl -sc -nsob -nss -ts8"
- }
- },
- /* [11] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {109, 14, 139, 201},
- "Common Styles"
- },
- /* [12] */
- NotDependent {
-
- },
- NestedDialog {
- 2,
- {149, 24, 168, 138},
- "Blank lines…",
- "Choose this button to set options contro"
- "lling the use of blank lines."
- },
- /* [13] */
- NotDependent {
-
- },
- NestedDialog {
- 3,
- {171, 24, 189, 138},
- "Comments…",
- "Choose this button to set options contro"
- "lling the formatting of comments."
- },
- /* [14] */
- NotDependent {
-
- },
- NestedDialog {
- 4,
- {149, 174, 168, 288},
- "Statements…",
- "Choose this button to set options contro"
- "lling the positioning of braces and form"
- "atting of statements."
- },
- /* [15] */
- NotDependent {
-
- },
- NestedDialog {
- 5,
- {171, 174, 189, 288},
- "Declarations…",
- "Choose this button to set options contro"
- "lling the formatting of declarations."
- },
- /* [16] */
- NotDependent {
-
- },
- NestedDialog {
- 6,
- {149, 333, 168, 447},
- "Indentation…",
- "Choose this button to set options contro"
- "lling levels of indentation."
- },
- /* [17] */
- NotDependent {
-
- },
- NestedDialog {
- 7,
- {171, 333, 189, 447},
- "Other options…",
- "Choose this button to set other options."
- },
- /* [18] */
- NotDependent {
-
- },
- VersionDialog {
- VersionString {
- "1.8"
- },
- "MPW port by Roberto Avanzi <gandalf"
- "@sabrina.dei.unipd.it> (v1.4-1.7). Updat"
- "ed to 1.8 by Franklin Chen <chen@adi.com>.",
- noDialog
- }
- },
- /* [2] */
- 203,
- "Blank lines. Note that setting or unsett"
- "ing any of these options will override t"
- "he corresponding settings from 'Indent P"
- "refs'.",
- { /* array itemArray: 4 elements */
- /* [1] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {22, 33, 38, 271}, "After blocks of declarations", "-nbad", "", "-bad", "[--blank-lines-after-declarations] Force"
- " a blank line after every block of decla"
- "rations. DEFAULTS: -nbad, -nbad, -nbad"
- }
- },
- /* [2] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {39, 33, 55, 271}, "After procedure bodies", "-nbap", "", "-bap", "[--blank-lines-after-procedures] Force a"
- " blank line after every procedure body. DEFAULTS: -bap, -bap, -nbap"
- }
- },
- /* [3] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {56, 33, 72, 271}, "After block comments", "-nbbb", "", "-bbb", "[--blank-lines-after-block-comments] For"
- "ce a blank line after every block commen"
- "t. DEFAULTS: -nbbb, -nbbb, -nbbb"
- }
- },
- /* [4] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {73, 33, 89, 271}, "Swallow optional blank lines", "-nsob", "", "-sob", "[--swallow-optional-blank-lines] Swallow"
- " optional blank lines. DEFAULTS: -nsob, -nsob, -nsob"
- }
- }
- },
- /* [3] */
- 241,
- "Comments. Note that setting or unsetting"
- " any of these options will override the "
- "corresponding settings from 'Indent Pref"
- "s'.",
- { /* array itemArray: 9 elements */
- /* [1] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {29, 13, 45, 223}, "Enable comment formatting", "-nfca", "", "-fca", "[--format-all-comments] Do not disable a"
- "ll formatting of comments. DEFAULTS: -nfca, -nfca, -fca"
- }
- },
- /* [2] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {60, 13, 76, 223}, "Comments in first column", "-nfc1", "", "-fc1", "[--format-first-column-comments] Format "
- "comments beginning in the first column. DEFAULTS: -nfc1, -nfc1, -fc1"
- }
- },
- /* [3] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {80, 13, 96, 223}, "Delimiters on blank lines", "-ncdb", "", "-cdb", "[--comment-delimiters-on-blank-lines] Pu"
- "t comment delimiters (‘/*’ and ‘*/’) on "
- "blank lines. DEFAULTS: -ncdb, -ncdb, -cdb"
- }
- },
- /* [4] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {100, 13, 116, 223}, "‘*’ at left of comments", "-nsc", "", "-sc", "[--start-left-side-of-comments] Put '*' "
- "at the left edge of all comments. DEFAULTS: -nsc, -nsc, -sc"
- }
- },
- /* [5] */
- NotDependent {
-
- },
- RegularEntry {
- "On own line",
- {33, 245, 51, 400},
- {32, 429, 48, 454},
- "",
- keepCase,
- "-d",
- "[--line-comments-indentation<n>] Set the"
- " indentation of comments not to the righ"
- "t of code to <n> spaces. DEFAULTS: , -d0, -d4"
- },
- /* [6] */
- NotDependent {
-
- },
- RegularEntry {
- "After code",
- {55, 245, 73, 400},
- {55, 429, 70, 454},
- "33",
- keepCase,
- "-c",
- "[--comment-indentation<n>] Put comments "
- "to the right of code in column <n>. DEFAULTS: -c33, -c33, -c33"
- },
- /* [7] */
- NotDependent {
-
- },
- RegularEntry {
- "After declarations",
- {77, 245, 93, 400},
- {77, 429, 90, 454},
- "33",
- keepCase,
- "-cd",
- "[--declaration-comment-column<n>] Put co"
- "mments to the right of declarations in c"
- "olumn <n>. The default is the column for"
- " comments to the right of code. DEFAULTS: -cd33, -cd33, -cd33"
- },
- /* [8] */
- NotDependent {
-
- },
- RegularEntry {
- "After ‘#else’ and ‘#endif’",
- {97, 245, 113, 423},
- {97, 429, 111, 454},
- "1",
- keepCase,
- "-cp",
- "[--else-endif-column<n>] Put comments to"
- " the right of #else and #endif statement"
- "s in column <n>. DEFAULTS: -cp1, -cp33, -cp33"
- },
- /* [9] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {23, 238, 124, 468},
- "Indent to column…"
- }
- },
- /* [4] */
- 239,
- "Statements.",
- { /* array itemArray: 10 elements */
- /* [1] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {37, 28, 53, 170}, "Brace positioning", "-bl", "", "-br", "(Clear) [-bl, --braces-after-if-line] Put bra"
- "ces line after ‘if’, etc. (Set) [-br, --braces-on-"
- "if-line] Put braces on same line as if, "
- "etc. DEFAULTS: -bl, -br, -br"
- }
- },
- /* [2] */
- NotDependent {
-
- },
- RegularEntry {
- "Brace indent",
- {58, 45, 74, 140},
- {58, 150, 74, 172},
- "2",
- keepCase,
- "-bli",
- "[--brace-indent<n>] Indent braces <n> sp"
- "aces. DEFAULTS: -bli2,,"
- },
- /* [3] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {80, 28, 96, 148}, "Cuddle else", "-nce", "", "-ce", "[--cuddle-else] Cuddle else and precedin"
- "g closing brace. DEFAULTS: -nce, -ce, -ce"
- }
- },
- /* [4] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {25, 17, 101, 190},
- "Braces"
- },
- /* [5] */
- NotDependent {
-
- },
- RegularEntry {
- "‘Case’ label indent",
- {107, 17, 124, 154},
- {107, 161, 123, 183},
- "0",
- keepCase,
- "-cli",
- "[--case-indentation<n>] Indent case labe"
- "ls <n> spaces to the right of the contai"
- "ning ‘switch’ statement. DEFAULTS: -cli0, -cli0, -cli0"
- },
- /* [6] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {35, 216, 53, 456}, "Before special semicolons", "-nss", "", "-ss", "[--space-special-semicolon] On one-line "
- "‘for’ and ‘while’ statements, force a bl"
- "ank before the semicolon. This emphasize"
- "s that the body of the ‘for’ or ‘while’ "
- "statement is an empty statment. DEFAULTS: -nss, -nss, -nss"
- }
- },
- /* [7] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {57, 216, 74, 459}, "After function calls", "-npcs", "", "-pcs", "[--space-after-procedure-calls] Place a "
- "space between the name of the function b"
- "eing called and the ‘(’. DEFAULTS: -pcs, -npcs, -npcs"
- }
- },
- /* [8] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {79, 216, 96, 463}, "After cast operator", "-ncs", "", "-cs", "[--space-after-cast] Put a space after a"
- " cast operator."
- }
- },
- /* [9] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {99, 216, 116, 457},
- "After ‘sizeof’ operator",
- "-bs",
- "[--Bill-Shannon] Put a space between ‘si"
- "zeof’ and its argument."
- },
- /* [10] */
- NotDependent {
-
- },
- TextBox {
- gray,
- {24, 202, 126, 468},
- "Space…"
- }
- },
- /* [5] */
- 225,
- "Declarations.",
- { /* array itemArray: 4 elements */
- /* [1] */
- NotDependent {
-
- },
- RegularEntry {
- "Variable declarations",
- {27, 22, 44, 175},
- {26, 180, 42, 200},
- "0",
- keepCase,
- "-di",
- "[--declaration-indentation<n>] Put varia"
- "ble names in column <n>. One may "
- "use a small value, e.g., 1 or 2, to caus"
- "e the identifiers to be placed in the fi"
- "rst available position. DEFAULTS: -di0, -di1, -di16"
- },
- /* [2] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {65, 17, 81, 296}, "Blank line after comma in declarations", "-nbc", "", "-bc", "[--blank-lines-after-commas] Force a bla"
- "nk line after each comma in a declaratio"
- "n. DEFAULTS: -nbc, -nbc, -bc"
- }
- },
- /* [3] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {83, 17, 100, 297}, "Procedure names start lines", "-npsl", "", "-psl", "[--procnames-start-lines] Place the type"
- " of a procedure on the line before its n"
- "ame. DEFAULTS: -psl, -npsl, -psl"
- }
- },
- /* [4] */
- NotDependent {
-
- },
- MultiRegularEntry {
- "Type names",
- {18, 308, 34, 425},
- {39, 311, 102, 462},
- { /* array DefEntryList: 0 elements */
- },
- "-T",
- "Type in the names of all the types in yo"
- "ur program defined by ‘typedef’."
- }
- },
- /* [6] */
- 210,
- "Use this dialog to specify indentation p"
- "arameters.",
- { /* array itemArray: 6 elements */
- /* [1] */
- NotDependent {
-
- },
- RegularEntry {
- "Indent level",
- {27, 21, 43, 114},
- {27, 118, 43, 140},
- "2",
- keepCase,
- "-i",
- "[--indent-level<n>] When the beginning o"
- "f a statement (such as ‘if’ or ‘for’) is"
- " encountered, the indentation level is i"
- "ncreased by <n> spaces. DEFAULTS: -i2, -i4, -i4"
- },
- /* [2] */
- NotDependent {
-
- },
- RegularEntry {
- "Continuation",
- {53, 21, 70, 114},
- {53, 118, 70, 140},
- "0",
- keepCase,
- "-ci",
- "[--continuation-indentation<n>] When a s"
- "tatement is continued from a previous li"
- "ne, it is indented by <n> additional spa"
- "ces. DEFAULTS: ,,-ci4"
- },
- /* [3] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {80, 19, 98, 281}, "Line up continuation at parentheses", "-nlp", "", "-lp", "[--continue-at-parentheses] Line up cont"
- "inued lines at parentheses. DEFAULTS: -lp, -lp, -lp"
- }
- },
- /* [4] */
- NotDependent {
-
- },
- RegularEntry {
- "Tab size",
- {26, 231, 42, 294},
- {26, 299, 42, 321},
- "8",
- keepCase,
- "-ts",
- "[--tab-size<n>] Set tab size to <n> spac"
- "es. Tabs are treated as the equivalent n"
- "umber of spaces. DEFAULTS: -ts8, -ts8, -ts8"
- },
- /* [5] */
- NotDependent {
-
- },
- RegularEntry {
- "Parameter indentation",
- {53, 231, 69, 389},
- {53, 392, 69, 412},
- "5",
- keepCase,
- "-ip",
- "[--parameter-indentation] Indent paramet"
- "er types in old-style function definitio"
- "ns by <n> spaces. DEFAULTS: -ip5, -ip0, -ip4"
- },
- /* [6] */
- NotDependent {
-
- },
- TriStateButtons {
- "",
- { /* array threeStateArray: 1 elements */
- /* [1] */
- {201, 194, 100, 456}, "Space between `#' and directive", "-nlps", "", "-lps", "[--leave-preprocessor-space] Leave space"
- " between `#' and preprocessor directive."
- " This space is permitted by ANSI C. Inde"
- "nt removes it by default."
- }
- }
- },
- /* [7] */
- 197,
- "Use this dialog to set miscellaneous opt"
- "ions.",
- { /* array itemArray: 5 elements */
- /* [1] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {23, 24, 41, 213},
- "No profile",
- "-npro",
- "[--ignore-profile] Do not read informati"
- "on from 'Indent Prefs'."
- },
- /* [2] */
- NotDependent {
-
- },
- RegularEntry {
- "Maximum line length",
- {54, 26, 70, 171},
- {54, 180, 70, 205},
- "",
- keepCase,
- "-l",
- "[--line-length<n>] Set the maximum line "
- "length to <n>. DEFAULTS: , -l75, -l75"
- },
- /* [3] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {23, 234, 41, 439},
- "Troff output",
- "-troff",
- "Output troff-formatted document. This op"
- "tion is strongly deprecated and unsuppor"
- "ted (and quite useless on a Mac without "
- "A/UX or the like). May be replaced by a "
- "\"TeX output\" option in the future."
- },
- /* [4] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {41, 234, 57, 447},
- "Verbose",
- "-v",
- "[--verbose] Enable verbose mode: report "
- "when a line of input is split, and displ"
- "ay size statistics at completion."
- },
- /* [5] */
- NotDependent {
-
- },
- CheckOption {
- NotSet,
- {58, 234, 74, 442},
- "Show version",
- "-version",
- "Display the version number of this copy "
- "of Indent."
- }
- }
- }
- };
-